<div>
    <fieldset id="EditReaderField" style="padding-top: 1em;">
        <legend><?php echo "Читатель ".@$this->data['name']; ?></legend>

        <input type="hidden" id="user_id" value="<?php echo $this->data['user_id']; ?>"/>
        <table>

            <tr><td></td><td class="ErrorMessage" data-field="log"></td></tr>

            <tr>
                <td><label for="login">Логин:</label></td>
                <td><input class="Text" type="text" id="login"
                    value="<?php echo @$this->data['login']; ?>"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="login"></td></tr>

            <tr>
                <td><label for="pass">Пароль:</label></td>
                <td><input class="Text" type="text" id="pass"
                    value="<?php echo @$this->data['pass']; ?>"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="pass"></td></tr>

            <tr>
                <td><label for="fullname">ФИО:</label></td>
                <td><input class="Text" type="text" id="fullname"
                   value="<?php echo @$this->data['fullname']; ?>"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="fullname"></td></tr>

            <tr>
                <td><label for="reg_date">Дата регистрации:</label></td>
                <td><input class="Text" type="text" id="reg_date"
                    value="<?php echo @$this->data['reg_date']; ?>"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="reg_date"></td></tr>

            <tr>
                <td><label for="reg_comp">Дата окончания:</label></td>
                <td><input class="Text" type="text" id="reg_comp"
                    value="<?php echo @$this->data['reg_comp']; ?>"/></td>
            </tr>
            <tr><td></td><td class="ErrorMessage" data-field="reg_comp"></td></tr>

        </table>
    </fieldset>

    <div class="ControlPanel">
        <button id="EditReader">Сохранить</button>
        <button id="CancelEdit">Отмена</button>
    </div>

    <script type="text/javascript">
        jsun.run(function() {
        //////////////////////////////////////////////////////

        jsun("#EditReader").jsun.event({ onclick: Edit });
        jsun("#CancelEdit").jsun.event({ onclick: Cancel });

        function Edit() {
            var param = "u=Lib/AltReader"
                + jsun.page.get_data({elem: ['user_id', 'fullname',
                    'login', 'pass', 'reg_comp', 'reg_date'] }).toString();

            jsun.json.load(function(p) {
                if (p.STAT != 'ERR') {
                    window.location.reload();
                } else {
                    jsun.show_err(p);
                }
            }, param);
        }

        function Cancel() {
            return jsun.dialog.active.close();
        }

        ///////////////////////////////////////////////////////
        });
    </script>
</div>